import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Layout',
      component: () => import('../views/Layout.vue'),
      meta: {
        title: "",
        menu: false
      },
      children: [
        {
          path: '',
          name: 'home',
          meta: {
            title: "首页",
            menu: true
          },
          component: () => import('../views/HomeView.vue')
        },
        {
          path: 'user',
          name: 'user',
          meta: {
            title: "用户",
            menu: true
          },
          component: () => import('../views/UserView.vue')
        },
        {
          path: 'generate',
          name: 'generate',
          meta: {
            title: "代码生成器",
            menu: true
          },
          component: () => import('../views/GenerateVue.vue')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      meta: {
        title: "登录",
        menu: false
      },
      component: () => import('../views/LoginView.vue')
    },
  ]
})

export default router
